const Service = require('egg').Service;
class spiderService extends Service{
	async getData(){
		let url = 'http://wiki.joyme.com/arknights/%E5%9B%BE%E9%89%B4%E4%B8%80%E8%A7%88';
		const result = await this.ctx.curl(url,{
			dataType:'text',
		});
		return result
	}
	async getDetail(name){
		let url = 'http://wiki.joyme.com/arknights/';
		url = url+name;
		const result = await this.ctx.curl(url,{
			dataType:'text',
		});
		return result
	}
	async getNew(){
		let url = 'http://wiki.joyme.com/arknights/新闻公告';
		const result = await this.ctx.curl(url,{
			dataType:'text',
		});
		return result
	}
	async getPhoto(page){
		let url = 'https://bcy.net/search/home?k=%E6%98%8E%E6%97%A5%E6%96%B9%E8%88%9F&p=';
		url = url+page;
		const result = await this.ctx.curl(url,{
			dataType:'text',
		});
		return result
	}
	async getPhotoDetail(detail){
		let url = 'https://bcy.net';
		url = url+detail;
		const result = await this.ctx.curl(url,{
			dataType:'text',
		});
		return result
	}
}

module.exports = spiderService;